<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>分页功能</title>
</head>
<body>
<ul>
    {% for stu in students %}
    <li>
        {{stu.sname}}--{{stu.sgrade}}
    </li>
    {% endfor %}
</ul>
<ul>
    {% for index in students.paginator.page_range %}
    <!--这个if是实现一个功能，即点了第2页之后，2就不能再点了 -->
    {% if index == students.number %}
    <li>
        {{index}}
    </li>
    {% else %}
    <li>
        <a href="/sunck/studentpage/{{index}}/">{{index}}</a>
    </li>
    {% endif %}
    {% endfor %}
</ul>
</body>
</html>